package com.topboya.linker.ui.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.topboya.linker.R;
import com.topboya.linker.model.response.ProductInforListReponse;
import com.topboya.linker.utils.UIUtils;

import java.util.ArrayList;

public class ProductAdapter extends BaseQuickAdapter<ProductInforListReponse.ProductDetailInfoList, BaseViewHolder> {


    public ProductAdapter(int layoutResId, ArrayList<ProductInforListReponse.ProductDetailInfoList> data) {
        super(layoutResId, data);

    }

    @Override
    protected void convert(BaseViewHolder helper, ProductInforListReponse.ProductDetailInfoList item) {

        helper.setText(R.id.tv_productName, item.getProductName())
               .setText(R.id.tv_productFactory, item.getProductFactory())
               .setGone(R.id.img_data, Integer.parseInt(item.getFileNum()) > 0 ? true : false);
        helper.getView(R.id.img_data).setOnClickListener(v -> UIUtils.showToast("资料展示，H5待开发"));

    }

}
